import request from '@/utils/request'

//添加/更新接口
export const AddOrUpdateApi = (data) => {
    if (data.id) {
        return request.post('/system/notice/update', data)
    } else {
        return request.post('/system/notice/save', data)
    }
}

//批量删除接口
export const removeApi = (ids) => {
    return request.get('/system/notice/remove/', {
        params: {ids: ids}
    });
};

//分页查询接口
export const findPageApi = (pageRequest) => {
    return request.post('/system/notice/findPage', pageRequest)
};

//发送消息
export const sendApi = (data) => {
    return request.post('/system/notice/send', data)
}

//获取未读消息数量
export const getUnreadCountApi = () => {
    return request.get('/system/notice/unread')
}

//分页查询接口
export const scrollPageApi = (pageRequest) => {
    return request.post('/system/notice/scrollPage', pageRequest)
};

//批量更新用户消息（批量已读）
export const allReadApi = (id) => {
    return request.get('/system/notice/isRead', {
        params: {id: id}
    });
};

//批量删除用户消息
export const removeUserNoticeApi = (ids) => {
    return request.get('/system/notice/removeMessage', {});
};